﻿@using KRM.Core
@model List<KRM.Core.KRWSP_getSuperCategoryListByDisplayName_Result>

@{
    var leftMenuCategory =(ViewBag.leftMenuCategory as IEnumerable<tblLeftMenuCat>).ToList();
}
<ul id='categories-list-ul'>
@foreach (var item in leftMenuCategory)
{
    var category = Model.FirstOrDefault(p => p.CategoryID == item.CategoryID);
    <li class='selectedLeftCat'>
                        <input id='cat-@category.CategoryID' type='checkbox' checked onchange='leftCatCheckBoxChange(@category.CategoryID)'/>
                        <label for='cat-@category.CategoryID'>@category.DisplayName</label>
                        <input id='display-@category.CategoryID' class='displayTextBox' value='@item.Text'/>
                    </li>
}
@foreach (var item in Model)
{
    if (leftMenuCategory.All(p => p.CategoryID != item.CategoryID))
    {
       <li><input id='cat-@item.CategoryID' type='checkbox' onchange='leftCatCheckBoxChange(@item.CategoryID)' /><label for='cat-@item.CategoryID'>@item.DisplayName</label>
 </li>
    }
     }
</ul>